package com.ctjsoft.fileupload.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ReturnMessage implements Serializable {
    private static final long serialVersionUID = 8802911744589920319L;

    private String code;

    private String msg;

    private Object data;

    public ReturnMessage(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ReturnMessage(String code, String msg, Object obj) {
        this.code = code;
        this.msg = msg;
        this.data = obj;
    }


    public ReturnMessage(String msg) {
        this.code = "0000";
        this.msg = msg;
    }

    public ReturnMessage() {
        this.code = "0000";
        this.msg = "请求成功";
    }

    public Map<String, Object> toMap() {
        Map<String, Object> model = new HashMap<>();
        model.put("code", this.code);
        model.put("msg", this.msg);
        model.put("data", this.data);
        return model;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
